/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : localhost:3306
 Source Schema         : imooc_mall

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 13/12/2020 19:34:42
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for imooc_mall_cart
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_cart`;
CREATE TABLE `imooc_mall_cart`
(
    `id`          int(11)   NOT NULL AUTO_INCREMENT COMMENT '主键',
    `product_id`  int(11)        DEFAULT NULL COMMENT '商品ID',
    `user_id`     int(11)        DEFAULT NULL COMMENT '用户ID',
    `quantity`    int(255)       DEFAULT NULL COMMENT '商品数量',
    `selected`    int(255)       DEFAULT NULL COMMENT '是否勾选',
    `create_time` timestamp NULL DEFAULT NULL,
    `update_time` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Table structure for imooc_mall_category
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_category`;
CREATE TABLE `imooc_mall_category`
(
    `id`          int(11)   NOT NULL AUTO_INCREMENT COMMENT '主键',
    `name`        varchar(255)   DEFAULT NULL COMMENT '分类目录名称',
    `type`        int(255)       DEFAULT NULL COMMENT '分类目录级别 1 一级 2 二级 3 三级',
    `parent_id`   int(11)        DEFAULT NULL COMMENT '父ID',
    `order_num`   int(11)        DEFAULT NULL COMMENT '目录展示排序值',
    `create_time` timestamp NULL DEFAULT NULL,
    `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 30
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Records of imooc_mall_category
-- ----------------------------
BEGIN;
INSERT INTO `imooc_mall_category`
VALUES (3, '新鲜水果', 1, 0, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (4, '橘子橙子', 2, 3, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (5, '海鲜水产', 1, 0, 2, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (6, '精选肉类', 1, 0, 3, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (7, '螃蟹', 2, 5, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (8, '鱼类', 2, 5, 2, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (9, '冷饮冻食', 1, 0, 4, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (10, '蔬菜蛋品', 1, 0, 5, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (11, '草莓', 2, 3, 2, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (12, '奇异果', 2, 3, 3, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (13, '海参', 2, 5, 3, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (14, '车厘子', 2, 3, 4, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (15, '火锅食材', 2, 27, 5, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (16, '牛羊肉', 2, 6, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (17, '冰激凌', 2, 9, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (18, '蔬菜综合', 2, 10, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (19, '果冻橙', 2, 10, 1, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (27, '美味菌菇', 1, 0, 7, NULL, '2020-12-13 18:57:07');
INSERT INTO `imooc_mall_category`
VALUES (28, '其他水果', 2, 3, 4, NULL, NULL);
INSERT INTO `imooc_mall_category`
VALUES (29, '鸭货', 2, 6, 10, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for imooc_mall_order
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_order`;
CREATE TABLE `imooc_mall_order`
(
    `id`               int(11)   NOT NULL AUTO_INCREMENT COMMENT '主键',
    `order_no`         varchar(255)   DEFAULT NULL COMMENT '订单号',
    `total_price`      int(10)        DEFAULT NULL COMMENT '订单总价',
    `receiver_name`    varchar(255)   DEFAULT NULL COMMENT '收货人姓名快照',
    `receiver_mobile`  varchar(255)   DEFAULT NULL COMMENT '收货人手机号快照',
    `receiver_address` varchar(255)   DEFAULT NULL COMMENT '收获地址快照',
    `order_status`     int(255)       DEFAULT NULL COMMENT '订单状态0用户取消10未付款20已付款30已发货40交易完成',
    `postage`          int(255)       DEFAULT NULL COMMENT '运费',
    `payment_type`     int(255)       DEFAULT NULL COMMENT '支付类型',
    `delivery_time`    timestamp NULL DEFAULT NULL COMMENT '发货时间',
    `pay_time`         timestamp NULL DEFAULT NULL COMMENT '支付时间',
    `end_time`         timestamp NULL DEFAULT NULL COMMENT '交易完成时间',
    `create_time`      timestamp NULL DEFAULT NULL COMMENT '创建时间',
    `update_time`      timestamp NULL DEFAULT NULL COMMENT '更新时间',
    `user_id`          int(11)        DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Table structure for imooc_mall_order_item
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_order_item`;
CREATE TABLE `imooc_mall_order_item`
(
    `id`           int(11)   NOT NULL AUTO_INCREMENT COMMENT '主键',
    `order_no`     varchar(255)   DEFAULT NULL COMMENT '归属订单',
    `product_id`   int(11)        DEFAULT NULL COMMENT '商品ID',
    `product_name` varchar(255)   DEFAULT NULL COMMENT '商品名称',
    `product_img`  varchar(255)   DEFAULT NULL COMMENT '商品图片',
    `unit_price`   int(10)        DEFAULT NULL COMMENT '单价',
    `quantity`     int(255)       DEFAULT NULL COMMENT '商品数量',
    `total_price`  int(10)        DEFAULT NULL COMMENT '商品总价',
    `create_time`  timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `update_time`  timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Table structure for imooc_mall_product
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_product`;
CREATE TABLE `imooc_mall_product`
(
    `id`          int(11)   NOT NULL AUTO_INCREMENT COMMENT '主键',
    `name`        varchar(255)   DEFAULT NULL COMMENT '商品名称',
    `image`       varchar(255)   DEFAULT NULL COMMENT '图片地址',
    `detail`      varchar(255)   DEFAULT NULL COMMENT '商品详情',
    `category_id` int(11)        DEFAULT NULL COMMENT '分类ID',
    `price`       int(10)        DEFAULT NULL COMMENT '价格',
    `stock`       int(255)       DEFAULT NULL COMMENT '库存',
    `status`      int(255)       DEFAULT NULL COMMENT '商品状态0下架1上架',
    `create_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Table structure for imooc_mall_user
-- ----------------------------
DROP TABLE IF EXISTS `imooc_mall_user`;
CREATE TABLE `imooc_mall_user`
(
    `id`                     int(11)   NOT NULL AUTO_INCREMENT COMMENT '用户ID',
    `username`               varchar(255)   DEFAULT NULL COMMENT '用户名',
    `password`               varchar(255)   DEFAULT NULL COMMENT '密码',
    `personalized_signature` varchar(255)   DEFAULT NULL COMMENT '个性签名',
    `role`                   int(255)       DEFAULT NULL COMMENT '角色：1普通用户，',
    `create_time`            timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`            timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 8
  DEFAULT CHARSET = utf8;

-- ----------------------------
-- Records of imooc_mall_user
-- ----------------------------
BEGIN;
INSERT INTO `imooc_mall_user`
VALUES (1, '1', '1', '666', 1, '2020-12-12 18:07:42', '2020-12-12 18:07:42');
INSERT INTO `imooc_mall_user`
VALUES (2, 'xiaomo', '12312123', NULL, NULL, NULL, NULL);
INSERT INTO `imooc_mall_user`
VALUES (3, 'momo,xiaomo', '123123123,12312123', NULL, NULL, NULL, NULL);
INSERT INTO `imooc_mall_user`
VALUES (4, 'momo', '123123123', NULL, NULL, NULL, NULL);
INSERT INTO `imooc_mall_user`
VALUES (5, 'test', '12312312', NULL, NULL, NULL, NULL);
INSERT INTO `imooc_mall_user`
VALUES (6, 'test1', '12312312', NULL, NULL, NULL, NULL);
INSERT INTO `imooc_mall_user`
VALUES (7, 'zhou', 'czkTnlvfXo+4W/MX2NWYvg==', '今天天气晴朗☀️goods', 2, '2020-12-13 18:06:49', '2020-12-13 18:06:49');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
